<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>dataset</title>
  <style media="screen">
    .content {
      width: 720px;
      height: 320px;
    }
  </style>
</head>
<body>
<div class="content" id="main"></div>

<script src="../../libs/echarts.min.js"></script>
<script>
  var char = echarts.init(document.getElementById('main'));

  var option = {
      legend: {},
      tooltip: {},
      dataset: {
          // 这里指定了维度名的顺序，从而可以利用默认的维度到坐标轴的映射。
          // 如果不指定 dimensions，也可以通过指定 series.encode 完成映射，参见后文。
          // dimensions: ['name', '2015', '2016', '2017'],
          // source: [
          //     {name: 'Matcha Latte', '2015': 43.3, '2016': 85.8, '2017': 93.7},
          //     {name: 'Milk Tea', '2015': 83.1, '2016': 73.4, '2017': 55.1},
          //     {name: 'Cheese Cocoa', '2015': 86.4, '2016': 65.2, '2017': 82.5},
          //     {name: 'Walnut Brownie', '2015': 72.4, '2016': 53.9, '2017': 39.1}
          // ]
          dimensions: ['name', 'count'],
          source: [
              {name: 'Matcha Latte', 'count': 43.3},
              {name: 'Milk Tea', 'count': 83.1},
              {name: 'Cheese Cocoa', 'count': 86.4},
              {name: 'Walnut Brownie', 'count': 72.4}
          ]
      },
      xAxis: {type: 'category'},
      yAxis: {},
      series: [
          {type: 'bar', name:'数据'},
          // {type: 'bar'},
          // {type: 'bar'}
      ]
  };

  char.setOption(option);
</script>
</body>
</html>
